package com.neuedu.ylbx.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.neuedu.ylbx.pojo.PatientRegistration;
import com.neuedu.ylbx.pojo.ginseng;
import com.neuedu.ylbx.service.ReimbursementDetailsService;
import com.neuedu.ylbx.utils.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/reimbursement")
@Api(tags = "参保人员详情查询")
@CrossOrigin
public class ReimbursementDetailsController {
    @Autowired
    private ReimbursementDetailsService reimbursementDetailsService;

    @ApiOperation("获取参保人员列表")
    @GetMapping("/getginseng")
    public ResultVo<List<ginseng>> getPatientsPage () throws Exception {
        return ResultVo.ok(reimbursementDetailsService.list());
    }

    @ApiOperation("获取参保人员详情信息")
    @GetMapping("/getginseng/{id}")
    public ResultVo getReimbursementDetail(String Id)throws Exception{
        QueryWrapper<ginseng> qw = new QueryWrapper<>();
        //查参保人员者id
        if (Id != null) {
            qw.eq("id", Id);
        }
        //执行查询
        List<ginseng> ginsengList = reimbursementDetailsService.list(qw);

        return ResultVo.ok(ginsengList);
    }

}
